package com.gvsoft.analyse.order;

import com.gvsoft.analyse.inf.IOrder;

/**
 * Created with IntelliJ IDEA.
 * ProjectName:gvMsgRouting
 * Author: zhaoqiubo
 * Date: 15/8/7
 * Time: 下午2:01
 * Desc: 指令基类
 */
public abstract class Order {


    //指令头，代表指令的分类
    String header;
    //指令编号
    String rid;


    private static int newRid = 0;

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public String getRid() {
        return rid;
    }

    public void setRid(String rid) {
        this.rid = rid;
    }

    /**
     * 返回指令序列号，该序列号仅作为响应的对应依据，不唯一，不可作为业务标记。
     *
     * @return
     */
    public static String getNewRid() {
        if (newRid > 1000000000) {
            newRid = 0;
        }
        newRid++;
        return Integer.toString(newRid);
    }

}
